<extend name="Order:alizi" />
<block name="body">
<div class="result">
	<h1><empty name="order.status"><img src="__PUBLIC__/Alizi/success.png"> {:lang('submit_success')}<else />{:lang('order_info')}</empty></h1>
    <div class="innner order_div success">
        <div class="order" style="min-height: calc(100vh - 140px);">
            <ul>
				<notempty name="order.status">
				<li><label>{:lang('order_status_colon')}</label><span><php>$status=C('ORDER_STATUS');</php>{$status[$order['status']]}</span></li>
				</notempty>
				<li><label>{:lang('order_number_colon')}</label><span>{$order.order_no}</span></li>
				<li><label>{:lang('item_name_colon')}</label><span>{$order.item_name}</span></li>
				<notempty name="order.item_params">
				<php>$params_name = getFields("Item","params_name",$order['item_id']);</php>
				<li><label><empty name="params_name">{:lang('itemPackage_colon')}<else />{$params_name}{:lang('colon')}</empty></label><span>{$order.item_params}</span></li>
				</notempty>
				<php>$extends = json_decode($order['item_extends'],true);</php>
				<php>$gift = json_decode($order['gift'],true);</php>
				<php>var_dump($gift);</php>
				<notempty name="extends">
				<volist name="extends" id="vo"><li><label>{$key}{:lang('colon')}</label><span><if condition="is_array($vo)">{$vo|implode="#",###}<else />{$vo}</if></span></li></volist>
				</notempty>
				<notempty name="options">
				<php>$opt=C('TEMPLATE_OPTIONS');$payment = C('PAYMENT');</php>
				<volist name="options" id="name">
					<php>if(in_array($name,array('verify','code','coupon'))){continue;}</php>
					<li>
						<label><php>echo $opt[$name]['name'];</php>{:lang('colon')}</label>
						<span>
							<switch name="name">
								<case value="price"><b>{:lang('symbol')}{$order['total_price']}</b></case>
								<case value="payment"><php>echo $payment[$order[$name]]['name'];</php></case>
								<default />{$order[$name]}
							</switch>
						</span>
					</li>
					</volist>
					<eq name="order.status" value="3">
						<php>$item = M('Item')->where('is_delete=0 and id='.$order['item_id'])->field('is_auto_send,send_content')->find();</php>
						<notempty name="item.is_auto_send">
						<li>
							<label>{:lang('info_colon')}</label>
							<span><pre style="margin-top:0;color:#f00;">{$item.send_content}</pre></span>
						</li>
						</notempty>
					</eq>
				<else />
					<!--li>{:lang('paymentSubmit')}</li-->	
				</notempty>
			</ul>
			<div class="result_info">{$aliziConfig.result_info}</div>
        </div>
		
        <div class="foot">
            <a style="margin: 0;" href="{$redirectUrl}" class="foot_btn">{:lang('goback')}</a>
			<!--<p>{$aliziConfig.footer}</p>-->
        </div>
    </div>
</div>

<notempty name="aliziConfig.mail_send">
<script type="text/javascript">
seajs.use(['jquery'],function($){ var order_id = "{$order['id']}";$.ajax({ url:"{:C('ALIZI_ROOT')}index.php?m=Api&a=send&order_id="+order_id,timeout:100 });});
</script>
</notempty>

<if condition="C('DEFAULT_LANG') neq 'zh-cn' && !empty($aliziConfig['facebook_pixel_id'])">
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '{$aliziConfig.facebook_pixel_id}', {em: 'insert_email_variable,'}); 
fbq('track', 'PageView');
fbq('track', 'Purchase', {
	content_type:'product',
	content_ids:['{$order.item_id}'],
	value: '{$order['total_price']|floatval}',
	currency: '{:L("currency")}'
});
</script>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id={$aliziConfig.facebook_pixel_id}&ev=PageView&noscript=1" /></noscript>
<!-- DO NOT MODIFY -->
<!-- End Facebook Pixel Code -->
</if>
</block>